<?php
	require_once "header.php";


	$isSuccess = 0 ;
	

	if(isset($_POST['btn_ok']))
	{
		require_once "trackingModify.php";
		
		$type_processACT = $_POST['tf_type_processACT'];
		$name = $_POST['tf_name'];
		$content = $_POST['tf_content'];
		$status = $_POST['rStatus'];
		
		$cSiteInfo = new CSiteInfo;
		
		
			
		$isSuccess = $cSiteInfo ->CSiteInfoUpdate($type_processACT,$name,$content,$status);
		
		$notification = "";
		
		switch($type_processACT)
		{
			case 1:
				//about
				$notification = "ABOUT_ACTION_EDIT_SUCCESS";
			break;
			case 2:
				//contact
				$notification ="CONTACT_ACTION_EDIT_SUCCESS";
			break;
			case 3:
				//term
				$notification ="TERM_ACTION_EDIT_SUCCESS";
			
			break;
		}
		
		if($isSuccess ==-1)
		{
			echo '<script language="javascript">window.location.href="main.php?notification=XXXX_ACTION_TO_SERVER"</script>';  
			return;
		}	
		else
		{
			if($isSuccess !=0)
			{

				echo '<script language="javascript">window.location.href="main.php?notification='.$notification.'"</script>';  
				return;
			}
		}
	}
	else
	{
		echo '<script language="javascript">window.location.href="main.php"</script>';  
	}
	
		



?>